<template>
    <div class="head">
        <van-nav-bar title="提现记录" left-arrow @click-left="onClickLeft" />
    </div>
    <div class="kong"></div>
    <div class="from">
        <table cellspacing=0>
            <thead>
                <tr>
                    <th>提现金额</th>
                    <th style="color: rgb(1,157,233);">实际到账金额</th>
                    <th>状态</th>
                    <th>提现时间</th>
                </tr>
            </thead>
            <tbody id="tbody">
                <tr v-for="(item, idnex) in widthData">
                    <td>{{ item.price }}</td>
                    <td style="color: rgb(1,157,233);">{{ item.result }}</td>
                    <td>{{ item.status == 1 ? "待审核":"已提现" }}</td>
                    <td>{{ item.time }}</td>
                </tr>
            </tbody>
        </table>
    </div>
</template>

<script setup>
import axios from 'axios';
import { ref } from 'vue';

const onClickLeft = () => history.back();
let userId = sessionStorage.getItem('userId')
let scienceData = JSON.parse(sessionStorage.getItem('scienceData'))
const widthData = ref()
axios({ //请求用户信息
    url: "/api/personal/withdrawlog", // url
    params: {
        // 参数
        userid: userId,
        scienceid: scienceData.id
    },
})
    .then(function (res) {
        console.log(res); // 成功回调
        widthData.value = res.data.data
    })
    .catch(function (err) {
        console.log(err); // 失败回调
    });
</script>

<style  scoped>
.head {
    width: 100%;
    height: auto;
    position: fixed;
    top: 0;
}

.kong {
    width: 100%;
    height: 50px;
}

.from {
    width: 100%;
    height: auto;
}

table {
    width: 100%;
    height: auto;

}

thead {
    font-size: 14px;
}

tbody {
    font-size: 12px;
}

tr {
    height: 40px;
}

td {
    min-width: 80px;
    text-align: center;

}</style>